import './index.scss'
import DailyTask from "../dailyTask";

const NEWLY_TASK = [
  {
    icon: 'task-comment',
    label: '直播间发消息 (0/3)',
    gifts: [
      {
        icon: 'exp',
        label: 'x15',
      }
    ],
    action: 'toLiveRoom'
  },
  {
    icon: 'task-follow',
    label: '关注主播 (0/3)',
    gifts: [
      {
        icon: 'exp',
        label: 'x50',
      }
    ],
    action: 'toLiveRoom'
  },
  {
    icon: 'task-download',
    label: '下载rabo',
    gifts: [
      {
        icon: 'gift',
        label: 'x15',
      }
    ],
    action: 'toDownload'
  },
  {
    icon: 'task-charge',
    label: '完成一笔充值 (0/3)',
    gifts: [
      {
        icon: 'exp',
        label: 'x500',
      }
    ],
    action: 'toCharge'
  }
]
const DAILY_TASK = [
  {
    icon: 'task-live',
    label: '观看直播5分钟',
    type: 'progress',
    gifts: [
      {
        icon: '',
        label: '00:00',
      },
      {
        icon: 'gift',
        label: '00:30',
      },
      {
        icon: 'gift',
        label: '01:00',
      },
      {
        icon: 'gift',
        label: '01:30',
      },
      {
        icon: 'gift',
        label: '02:00',
      }
    ],
    action: 'toLiveRoom'
  },
  {
    icon: 'task-share',
    label: '分享直播间 (0/3)',
    gifts: [
      {
        icon: 'exp',
        label: 'x50',
      }
    ],
    action: 'toLiveRoom'
  },
  {
    icon: 'task-gift',
    label: '送礼',
    gifts: [
      {
        icon: 'diamond',
        label: '1=',
      },
      {
        icon: 'exp',
        label: '1',
      }
    ],
    action: 'toDownload'
  },
]
const SIGN_TASK = [
  {
    icon: 'task-gift',
    label: '累计签到30天',
    gifts: [
      {
        icon: 'car',
        label: 'x1',
      }
    ],
    action: 'toSign'
  },
]

const toRule = () => {
  window.location.href = "/layout/sign-up/rule"
}

function Task(props) {
  return (
    <div className="Task">
      <h3 className="header">任务中心<button className="rule-btn" onClick={toRule}/></h3>
      {props.children || ''}
      <DailyTask data={NEWLY_TASK} title={"新手任务"}/>
      <DailyTask data={DAILY_TASK} title={"每日任务"}/>
      <DailyTask data={SIGN_TASK} title={"签到任务"}/>
    </div>
  )
}

export default Task
